package com.xyht.sca_s.student_manage_system.modules.assetStatistics.controller;


import com.xyht.sca_s.student_manage_system.common.annotation.RequestPass;
import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import com.xyht.sca_s.student_manage_system.common.desEncodeAndDecode.annotation.SecretBody;
import com.xyht.sca_s.student_manage_system.modules.assetStatistics.service.SmsAssetStatisticsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 资产统计表 前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2024-10-27
 */
@RestController
@RequestMapping("/assetStatistics")
@SecretBody
public class SmsAssetStatisticsController {


    @Resource
    private SmsAssetStatisticsService smsAssetStatisticsService;


    //固定资产
    @ApiOperation("固定资产分类账户统计")
    @GetMapping("/fixedCategoryStatistics")
    public ResponseResult getAssetFixedCategoryStatistics(@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                                          @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                          @RequestParam("type") Integer type,
                                                          @RequestParam("dateStr") String dateStr,
                                                          @RequestParam(value = "assetName", required = false) String assetName,
                                                          @RequestParam(value = "assetModel", required = false) String assetModel,
                                                          @RequestParam(value = "assetBrand", required = false) String assetBrand,
                                                          @RequestParam(value = "assetCategoryId", required = false) String assetCategoryId) {
        return smsAssetStatisticsService.getAssetFixedCategoryStatistics(type, dateStr, assetName, assetModel, assetBrand, assetCategoryId, pageSize, pageNum);

    }

    @ApiOperation("固定资产使用统计")
    @GetMapping("/fixedUseStatistics")
    public ResponseResult getAssetFixedUseStatistics(@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                                     @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                     @RequestParam(value = "assetName", required = false) String assetName,
                                                     @RequestParam(value = "assetModel", required = false) String assetModel,
                                                     @RequestParam(value = "assetBrand", required = false) String assetBrand,
                                                     @RequestParam(value = "assetCategoryId", required = false) String assetCategoryId,
                                                     @RequestParam(value = "assetStatus", required = false) Integer assetStatus,
                                                     @RequestParam(value = "ownerName", required = false) String ownerName,
                                                     @RequestParam(value = "departmentName", required = false) String departmentName) {
        return smsAssetStatisticsService.getAssetFixedUseStatistics(assetName, assetModel, assetBrand, assetCategoryId, assetStatus, ownerName, departmentName, pageSize, pageNum);

    }


    @ApiOperation("固定资产处置明细使用统计")
    @GetMapping("/fixedOutStatistics")
    public ResponseResult getAssetFixedOutStatistics(@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                                     @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                     @RequestParam(value = "assetName", required = false) String assetName,
                                                     @RequestParam(value = "assetModel", required = false) String assetModel,
                                                     @RequestParam(value = "assetBrand", required = false) String assetBrand,
                                                     @RequestParam(value = "assetCategoryId", required = false) String assetCategoryId,
                                                     @RequestParam(value = "assetDetailStatus", required = false) Integer assetDetailStatus,
                                                     @RequestParam(value = "ownerName", required = false) String ownerName,
                                                     @RequestParam(value = "departmentName", required = false) String departmentName) {
        return smsAssetStatisticsService.getAssetFixedOutStatistics(assetName, assetModel, assetBrand, assetCategoryId, assetDetailStatus, ownerName, departmentName, pageSize, pageNum);

    }

    @ApiOperation("固定资产新增/维修/处置统计")
    @GetMapping("/fixedNewAddAndRepairAndOutStatistics")
    public ResponseResult getAssetFixedNewAddAndRepairAndOutStatistics(@RequestParam(value = "yearStr") String yearStr,
                                                                       @RequestParam(value = "type") Integer type) {
        return smsAssetStatisticsService.getAssetFixedNewAddAndRepairAndOutStatistics(yearStr,type);

    }

    @ApiOperation("固定资产概况统计(图表)")
    @GetMapping("/fixedOverViewStatistics")
    public ResponseResult getAssetFixedOverViewStatistics(@RequestParam(value = "viewType") Integer viewType) {
        return smsAssetStatisticsService.getAssetFixedOverViewStatistics(viewType);
    }

    @ApiOperation("固定资产分类/部门/使用位置统计(图表)")
    @GetMapping("/fixedCategoryAndDepAndPlaceStatistics")
    public ResponseResult getAssetFixedCategoryAndDepAndPlaceStatistics(@RequestParam(value = "statisticsType") Integer statisticsType) {
        return smsAssetStatisticsService.getAssetFixedCategoryAndDepAndPlaceStatistics(statisticsType);
    }

    @ApiOperation("固定资产月新增/维修/处置统计(图表)")
    @GetMapping("/fixedNewAddAndRepairAndOutYearStatistics")
    public ResponseResult getAssetFixedNewAddAndRepairAndOutYearStatistics(@RequestParam(value = "yearStr") String yearStr) {
        return smsAssetStatisticsService.getAssetFixedNewAddAndRepairAndOutYearStatistics(yearStr);
    }


    //易耗品
    @ApiOperation("易耗品入库/领用统计")
    @GetMapping("/consumableInStorageAndBorrowStatistics")
    public ResponseResult getAssetConsumableInStorageAndBorrowStatistics(@RequestParam(value = "yearStr") String yearStr,
                                                                          @RequestParam(value = "type") Integer type) {
        return smsAssetStatisticsService.getAssetConsumableInStorageAndBorrowStatistics(yearStr,type);

    }

    @ApiOperation("易耗品入库/领用统计(图表)")
    @GetMapping("/consumableInAndOutStorageStatistics")
    public ResponseResult getAssetConsumableInAndOutStorageStatistics(@RequestParam(value = "yearStr") String yearStr) {
        return smsAssetStatisticsService.getAssetConsumableInAndOutStorageStatistics(yearStr);

    }




}

